{% extends "tj3/tj3.html" %}

{% block navigation %}
	<script type="text/javascript">
		$('document').ready(function(){
			$('#assign_btn').button();
			$('#cancel_btn').button();
		});
	</script>
{% endblock navigation %}

{% block content  %} 

<div class="ui-widget ui-widget-content">
	<h1 class="ui-widget ui-widget-header">{{task.project.name}}/{{task.name}}<span class="float_right">Resource Assignment</span></h1>
	{% if duplicate_resource %}
	
    	{% if duplicate_resource %}
    		<div class="ui-state-error mycontent fancy ui-corner-all">
    		<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
    		A person was assigned twice to this task!</div>
    	{% endif %}
                        	
                        		
	{% endif %}
	
	<form action="." method="post" enctype="multipart/form-data">
		<div class="mycontent">
		{% for r in resources %}
			<h2 class="ui-state-highlight ui-corner-all">
				<input type="checkbox" name="resource" value={{r.id}} />
				{{r.first_name|capfirst}} {{r.last_name|capfirst}}
				<a href="{% url resource_create %}" class="ui-icon ui-icon-plusthick float_right" title="Create a new resource"></a>
				<a href="{% url resource_edit r.id %}" class="ui-icon ui-icon-wrench float_right" title="Edit resource"></a>
			</h2>
			<ul>
				<li>General restriction: {{r.work_limit.min}} - {{r.work_limit.max}}
				<li>Daily: {{r.work_limit.dailymin}} - {{r.work_limit.dailymax}}
				<li>Weekly: {{r.work_limit.weeklymin}} - {{r.work_limit.weeklymax}}
				<li>Monthly: {{r.work_limit.monthlymin}} - {{r.work_limit.monthlymax}}
			</ul>
		{% endfor %}
		</div>
    	<div class="float_right">
   			<input id="assign_btn" type="submit" name="command" value="Assign" class="button" />
   			<input id="cancel_btn" type="submit" name="command" value="Cancel" class="button" />
   		</div>
                                                       	
	</form>
</div>
{% endblock content %}
